h1 Manage Contributors
iron-ajax#RemoveContribAjax(method='DELETE', url='/api/workgroup/remove-contributor/[[ownedNamespace.namespace]]',
    on-response='handleContribDelete', on-error='handleContribDelete', handle-as='json', content-type='application/json')
iron-ajax#AddContribAjax(method='POST', url='/api/workgroup/add-contributor/[[ownedNamespace.namespace]]',
    on-response='handleContribCreate', on-error='handleContribCreate', handle-as='json', content-type='application/json')
iron-ajax#GetContribsAjax(auto='[[!empty(ownedNamespace)]]', url='/api/workgroup/get-contributors/[[ownedNamespace.namespace]]',
    last-response='{{contributorList}}', on-error='onContribFetchError', handle-as='json')
iron-ajax#GetAllNamespacesAjax(auto='[[shouldFetchAllNamespaces(ownedNamespace, isClusterAdmin)]]', url='/api/workgroup/get-all-namespaces',
    last-response='{{allNamespaces}}', on-error='onAllNamespaceFetchError', handle-as='json')
section#Main-Content
    article.Acct-Info
        h2
            iron-icon.icon(icon='social:person-outline')
            span.text Account info
            span(hidden$='[[!isClusterAdmin]]') &nbsp; (Cluster Admin)
        .content
            span [[user]]
    h2#NoNamespaceError(hidden$='[[!empty(ownedNamespace)]]') You have no owned namespaces!
    article.Namespaces(hidden$='[[empty(ownedNamespace)]]')
        h2
            iron-icon.icon(icon='kubeflow:namespace')
            span.text Namespace memberships
        .content.small
            vaadin-grid(items='[[nsBreakdown(namespaces, ownedNamespace)]]', theme="no-border", height-by-rows, multi-sort)
                vaadin-grid-column(width='15em', path='0', flex-grow='2', header='Namespaces')
                vaadin-grid-column(width='9em', path='1', header='Your role')
    article.Contributors(hidden$='[[empty(ownedNamespace)]]')
        h2
            iron-icon.icon(icon='kubeflow:namespace')
            span.text Contributors to your namespace - [[ownedNamespace.namespace]]
        .content.small
            md2-input(label='Email Addresses', value='{{newContribEmail}}', on-submit='addNewContrib', placeholder='Add by email address', error$='[[contribCreateError]]')
                .prefix(slot='prefix')
                    template(is='dom-repeat', items='[[contributorList]]')
                        paper-chip(on-remove='removeContributor') [[item]]
    article.Cluster-Namespaces(hidden$='[[empty(isClusterAdmin)]]')
        h2
            iron-icon.icon(icon='kubeflow:namespace')
            span.text Cluster namespaces
        .content
            vaadin-grid(items='[[allNamespaces]]', theme="no-border", height-by-rows, multi-sort)
                vaadin-grid-column(width='9em', path='0', header='Namespace')
                vaadin-grid-column(width='10em', path='1', header='Owner')
                vaadin-grid-column(width='15em', path='2', flex-grow='2', header='Contributors')
paper-toast#ContribError(duration=5000)
    | Failed to fetch contributor list for {{ownedNamespace.namespace}}, because: 
    strong [[contribError]]
paper-toast#AllNamespaceError(duration=5000)
    | Failed to fetch all namespaces, because:
    strong [[allNamespaceError]]
